/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csse3004.GD.PM;

import org.springframework.validation.Validator;
import org.springframework.validation.Errors;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
 *
 * @author s4201567 Tony Yu
 */
public class ParticipantListDetailsValidator implements Validator {
    
    protected final Log logger = LogFactory.getLog(getClass());
    
    public boolean supports(Class clazz) {
        return ParticipantListDetails.class.equals(clazz);
    }
    
    public void validate(Object obj, Errors errors) {
        ParticipantListDetails pld = (ParticipantListDetails)obj;
        
        String fieldType = pld.getField();
        
        logger.info(fieldType);
        
        if (fieldType == "Other") {
            logger.info("Hello");
        } else {
            logger.info("Other field than 'field' has been selected.");
        }
    }
}

